
package com.bonc.excel.dto;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonFormat;
//import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;


@Getter
@Setter
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY, getterVisibility = JsonAutoDetect.Visibility.NONE,
		setterVisibility = JsonAutoDetect.Visibility.NONE)

@Data
public class BaseEntity {

	//@ApiModelProperty("自增主键")
	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	//@ApiModelProperty("创建时间")
	@TableField(value = "CreateTime", fill = FieldFill.INSERT)
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private LocalDateTime createTime;

	public static void main(String[] args) {
	/*	String fieldName = "old";
		String upperCasField = "Old";
		String setStr = "public void set%s(String %s){this.%s = %s;}";
		String getStr = "public void get%s(){this.%s;}";
		String format = String.format(setStr, upperCasField, fieldName, fieldName, fieldName);
		System.out.println(format);*/
		String longest = "1_2";
		String[] split = longest.split("_");
		for (int i = 1; i <= longest.length(); i++) {
			// 截取字符串的前i个字符，并在每个字符后面加上空格
			if(i %2 ==0){
				continue;
			}
			System.out.println(longest.substring(0, i));
		}
	}
}

